/*
 * 大巨变的新职业可以查看WZ的Skill.wz排序看到是从3000——3512
 * 3000是反抗者的新手—预备兵
 * 3200 3210 3211 3212也是反抗者的职业
 * 3300 3310 3311 3312也是反抗者的职业
 * 3500 3510 3511 3512也是反抗者的职业
 * 就以上这些反抗者,然后添加到下面的枚举中，名字可以自己随便取，只要后面的职业ID不错
*/

package net.sf.odinms.client;

public enum MapleJob {

    BEGINNER(0),//新手
    WARRIOR(100),//战士
    FIGHTER(110),//剑客
    CRUSADER(111),//勇士
    HERO(112),//英雄
    PAGE(120),
    WHITEKNIGHT(121),
    PALADIN(122),
    SPEARMAN(130),
    DRAGONKNIGHT(131),
    DARKKNIGHT(132),
    MAGICIAN(200),
    FP_WIZARD(210),
    FP_MAGE(211),
    FP_ARCHMAGE(212),
    IL_WIZARD(220),
    IL_MAGE(221),
    IL_ARCHMAGE(222),
    CLERIC(230),
    PRIEST(231),
    BISHOP(232),
    BOWMAN(300),
    HUNTER(310),
    RANGER(311),
    BOWMASTER(312),
    CROSSBOWMAN(320),
    SNIPER(321),
    CROSSBOWMASTER(322),
    THIEF(400),
    ASSASSIN(410),
    HERMIT(411),
    NIGHTLORD(412),//隐之侠士
    BANDIT(420),
    CHIEFBANDIT(421),
    SHADOWER(422),
    //双刀
    Dual_Blade_1(430),
    Dual_Blade_2(431),
    Dual_Blade_3(432),
    Dual_Blade_4(433),
    Dual_Blade_5(434),
    
    PIRATE(500),
    BRAWLER(510),
    MARAUDER(511),
    BUCCANEER(512),
    GUNSLINGER(520),
    OUTLAW(521),
    CORSAIR(522),
    GM(900),
    //骑士团
    KNIGHT(1000),
    GHOST_KNIGHT(1100),
    GHOST_KNIGHT_2(1110),
    GHOST_KNIGHT_3(1111),
    FIRE_KNIGHT(1200),
    FIRE_KNIGHT_2(1210),
    FIRE_KNIGHT_3(1211),
    WIND_KNIGHT(1300),
    WIND_KNIGHT_2(1310),
    WIND_KNIGHT_3(1311),
    NIGHT_KNIGHT(1400),
    NIGHT_KNIGHT_2(1410),
    NIGHT_KNIGHT_3(1411),
    THIEF_KNIGHT(1500),
    THIEF_KNIGHT_2(1510),
    THIEF_KNIGHT_3(1511),
    //战神
    Aran(2000),
    Aran_1(2100),
    Aran_2(2110),
    Aran_3(2111),
    Aran_4(2112),
    //添加龙神新职业
    Evan(2001),
    Evan_1(2200),
    Evan_2(2210),
    Evan_3(2211),
    Evan_4(2212),
    Evan_5(2213),
    Evan_6(2214),
    Evan_7(2215),
    Evan_8(2216),
    Evan_9(2217),
    Evan_10(2218),

    fuck1(800),
    fuck2(9000),
    fuck3(9100),
    //添加反抗者职业,然后再去登陆程序中创建人物那添加即:CreateCharhandle这个类
    Resistance(3000), //预备兵

    Battlemage_1(3200), //幻灵斗师
    Battlemage_2(3210),
    Battlemage_3(3211),
    Battlemage_4(3212),

    wildhunter_1(3300),//弩豹游侠
    wildhunter_2(3310),
    wildhunter_3(3311),
    wildhunter_4(3312),

    mechinic_1(3500),//机械师
    mechinic_2(3510),
    mechinic_3(3511),
    mechinic_4(3512),
    
    //副职业
    采矿(9200),
    采药(9201),
    装备制作(9202),
    饰品制作(9203),
    炼金术(9204),
    ;
    
    final int jobid;
    
    

    private MapleJob(int id) {
        jobid = id;
    }

    public int getId() {
        return jobid;
    }

    public static MapleJob getById(int id) {
        for (MapleJob l : MapleJob.values()) {
            if (l.getId() == id) {
                return l;
            }
        }
        return null;
    }

    public static MapleJob getBy5ByteEncoding(int encoded) {
        switch (encoded) {
            case 2:
                return WARRIOR;
            case 4:
                return MAGICIAN;
            case 8:
                return BOWMAN;
            case 16:
                return THIEF;
            case 32:
                return PIRATE;
            default:
                return BEGINNER;
        }
    }

    public boolean isA(MapleJob basejob) {
        return getId() >= basejob.getId() && getId() / 100 == basejob.getId() / 100;
    }

    public String getJobNameAsString() {
        MapleJob job = this;
        if (job == BEGINNER) {
            return "新手";
        } else if (job == THIEF) {
            return "飞侠";
        } else if (job == WARRIOR) {
            return "战士";
        } else if (job == MAGICIAN) {
            return "魔法师";
        } else if (job == BOWMAN) {
            return "弓箭手";
        } else if (job == PIRATE) {
            return "海盗";
        } else if (job == BANDIT) {
            return "侠客";
        } else if (job == ASSASSIN) {
            return "刺客";
        } else if (job == SPEARMAN) {
            return "枪战士";
        } else if (job == PAGE) {
            return "准骑士";
        } else if (job == FIGHTER) {
            return "剑客";
        } else if (job == CLERIC) {
            return "牧师";
        } else if (job == IL_WIZARD) {
            return "冰雷法师";
        } else if (job == FP_WIZARD) {
            return "火毒法师";
        } else if (job == HUNTER) {
            return "猎人";
        } else if (job == CROSSBOWMAN) {
            return "弩弓手";
        } else if (job == GUNSLINGER) {
            return "Gunslinger";
        } else if (job == BRAWLER) {
            return "Brawler";
        } else if (job == CHIEFBANDIT) {
            return "独行客";
        } else if (job == HERMIT) {
            return "无影人";
        } else if (job == DRAGONKNIGHT) {
            return "黑骑士";
        } else if (job == WHITEKNIGHT) {
            return "骑士";
        } else if (job == CRUSADER) {
            return "勇士";
        } else if (job == PALADIN) {
            return "圣骑士";
        } else if (job == PRIEST) {
            return "祭祀";
        } else if (job == IL_MAGE) {
            return "冰雷/巫师";
        } else if (job == FP_MAGE) {
            return "火毒/巫师";
        } else if (job == RANGER) {
            return "射手";
        } else if (job == SNIPER) {
            return "游侠";
        } else if (job == MARAUDER) {
            return "Marauder";
        } else if (job == OUTLAW) {
            return "Outlaw";
        } else if (job == SHADOWER) {
            return "侠盗";
        } else if (job == NIGHTLORD) {
            return "隐士";
        } else if (job == DARKKNIGHT) {
            return "Dark Knight";
        } else if (job == HERO) {
            return "英雄";
        } else if (job == PALADIN) {
            return "圣骑士";
        } else if (job == IL_ARCHMAGE) {
            return "魔导师/冰雷";
        } else if (job == FP_ARCHMAGE) {
            return "魔导师/火毒";
        } else if (job == BOWMASTER) {
            return "神射手";
        } else if (job == CROSSBOWMASTER) {
            return "箭神";
        } else if (job == BUCCANEER) {
            return "Buccaneer";
        } else if (job == CORSAIR) {
            return "Corsair";
        }
        else if (job == Resistance) {
            return "预备兵";
        }
        else {
            return "管理员";
        }
    }

   public static boolean isExtendSPJob(MapleJob job) {
        return isExtendSPJob(job.getId());
   }

   public static boolean isEvan(int jobid) {
     return (jobid == 2001) || (jobid / 100 == 22);
   }

   public static boolean isExtendSPJob(int jobId) {
        return (jobId / 1000 == 3) || (jobId / 100 == 22) || (jobId == 2001);
   }

   public static boolean isExtendSPJobEx(int jobId) {
         return ((jobId >= 3200) && (jobId <= 3512)) || (jobId / 100 == 22);
   }
}